/ Software of the Month Club 1999 November
/ SOTMC_Nov1999-Ultimate.iso / mac / REALbasic ƒ / Examples / Techniques / Examples by Thomas Tempelmann / FAQs from RB-NUG mailing list / function parameters ![]() | < prev | next > |
MacBinary | 1999-07-06 | 1.9 KB | [clpt/drag] |
Confidence | Program | Detection | Match Type | Support |
---|---|---|---|---|
1% | dexvert | MacBinary (archive/macBinary) | fallback | Supported |
100% | file | MacBinary II, inited, Sun May 2 11:27:25 1999, modified Tue Jul 6 15:26:42 1999, creator 'drag', type 'clpt' "function parameters", at 0x80 1720 bytes resource Apple HFS/HFS+ resource fork, map offset 0x64a, map length 0x6e, data length 0x54a, at 16 0xbb118bce, nextResourceMap 0x975f700, fileRef 0x336a, list offset 0x1c, name offset 0x6e, 4 types, 0x54455854 'TEXT' * 1 resource offset 0x22 | default (weak) | |
99% | file | data | default | |
74% | TrID | Mac Text clippings (MacBinary) | default | |
25% | TrID | MacBinary 2 | default (weak) | |
100% | dearkID | deark: macbinary | default | |
100% | lsar | MacBinary | default |
id metadata | |
---|---|
key | value |
macFileType | [clpt] |
macFileCreator | [drag] |
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 00 13 66 75 6e 63 74 69 | 6f 6e 20 70 61 72 61 6d |..functi|on param|
|00000010| 65 74 65 72 73 00 00 00 | 00 00 00 00 00 00 00 00 |eters...|........|
|00000020| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000030| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000040| 00 63 6c 70 74 64 72 61 | 67 01 00 00 00 00 00 00 |.clptdra|g.......|
|00000050| 00 00 00 00 00 00 00 00 | 00 06 b8 b3 52 1f 5d b3 |........|....R.].|
|00000060| a8 08 f2 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000070| 00 00 00 00 00 00 00 00 | 00 00 81 81 7e 52 00 00 |........|....~R..|
|00000080| 00 00 01 00 00 00 06 4a | 00 00 05 4a 00 00 00 6e |.......J|...J...n|
|00000090| bb 11 8b ce 61 1d 0d 01 | ca 1c fe e2 e4 1a 7c 68 |....a...|......|h|
|000000a0| 60 2f 42 c0 72 08 13 1e | 10 c0 a1 9c 11 0b f3 2c |`/B.r...|.......,|
|000000b0| 74 b8 30 cb de 3d 33 fa | 98 c9 e2 00 b0 dc 87 0b |t.0..=3.|........|
|000000c0| 09 07 26 0c d9 20 81 3f | 0e 46 e4 ff 05 d8 04 32 |..&.. .?|.F.....2|
|000000d0| 9c c5 8b 09 0c 64 bc c6 | 71 d9 47 90 02 47 ea 04 |.....d..|q.G..G..|
|000000e0| a9 e0 64 ca 79 fa 0a 0c | 1c e7 f2 cb 17 0a e4 e6 |..d.y...|........|
|000000f0| 6d 6c 28 10 27 c2 83 08 | 3f 48 2d 70 a0 a7 bf 94 |ml(.'...|?H-p....|
|00000100| fb 0e 60 28 20 f4 da b9 | 2f d0 72 75 c0 80 d0 e6 |..`( ...|/.ru....|
|00000110| 85 02 17 06 8a 54 7b f3 | 83 03 ae 78 7c 16 e1 20 |.....T{.|...x|.. |
|00000120| ef c0 59 73 b9 a8 e1 13 | a0 68 13 b3 06 69 35 b2 |..Ys....|.h...i5.|
|00000130| 8b ea e0 42 61 ae 5c c1 | c8 25 22 4f e0 87 41 ab |...Ba.\.|.%"O..A.|
|00000140| 2e 8d a1 46 0d 94 3e 77 | dc 80 e5 fa 12 4e eb 87 |...F..>w|.....N..|
|00000150| 02 71 af ce 95 77 41 c0 | 02 06 ab 52 ff 69 35 a6 |.q...wA.|...R.i5.|
|00000160| 4f 38 0d a8 2d a5 de c3 | 00 75 25 46 a4 fc 59 f8 |O8..-...|.u%F..Y.|
|00000170| 59 0e f6 ec df ac 5a 21 | 50 13 1b 38 ea e3 08 6a |Y.....Z!|P..8...j|
|00000180| 00 00 04 d0 47 75 79 72 | 65 6e 20 47 20 48 6f 77 |....Guyr|en G How|
|00000190| 65 20 77 72 6f 74 65 3a | 0d 0d 3e 57 61 79 20 62 |e wrote:|..>Way b|
|000001a0| 61 63 6b 20 77 68 65 6e | 2c 20 74 68 65 72 65 20 |ack when|, there |
|000001b0| 77 61 73 20 64 69 73 63 | 75 73 73 69 6f 6e 20 61 |was disc|ussion a|
|000001c0| 62 6f 75 74 20 6d 61 6b | 69 6e 67 20 6d 65 74 68 |bout mak|ing meth|
|000001d0| 6f 64 73 20 61 20 70 61 | 72 61 6d 65 74 65 72 20 |ods a pa|rameter |
|000001e0| 74 79 70 65 2e 0d 3e 43 | 6f 6e 73 69 64 65 72 20 |type..>C|onsider |
|000001f0| 74 68 69 73 20 61 20 66 | 65 61 74 75 72 65 20 72 |this a f|eature r|
|00000200| 65 71 75 65 73 74 20 28 | 61 6c 6f 6e 67 20 77 69 |equest (|along wi|
|00000210| 74 68 20 63 6c 61 73 73 | 20 70 61 72 61 6d 65 74 |th class| paramet|
|00000220| 65 72 73 20 61 6e 64 20 | 6d 65 74 68 6f 64 73 29 |ers and |methods)|
|00000230| 2e 0d 0d 54 68 61 74 27 | 73 20 65 78 61 63 74 6c |...That'|s exactl|
|00000240| 79 20 77 68 61 74 20 43 | 6c 61 73 73 20 49 6e 74 |y what C|lass Int|
|00000250| 65 72 66 61 63 65 73 20 | 61 72 65 20 66 6f 72 21 |erfaces |are for!|
|00000260| 0d 0d 45 78 61 6d 70 6c | 65 3a 0d 0d 43 72 65 61 |..Exampl|e:..Crea|
|00000270| 74 65 20 61 20 43 6c 61 | 73 73 20 49 6e 74 65 72 |te a Cla|ss Inter|
|00000280| 66 61 63 65 2c 20 63 61 | 6c 6c 20 69 74 20 22 44 |face, ca|ll it "D|
|00000290| 6f 61 62 6c 65 22 2c 20 | 61 6e 64 20 61 64 64 20 |oable", |and add |
|000002a0| 74 68 65 0d 66 6f 6c 6c | 6f 77 69 6e 67 20 6d 65 |the.foll|owing me|
|000002b0| 74 68 6f 64 20 64 65 66 | 69 6e 69 74 69 6f 6e 20 |thod def|inition |
|000002c0| 74 6f 20 69 74 3a 0d 0d | 20 20 53 75 62 20 44 6f |to it:..| Sub Do|
|000002d0| 49 74 28 29 0d 0d 54 68 | 65 6e 20 63 72 65 61 74 |It()..Th|en creat|
|000002e0| 65 20 61 20 63 6c 61 73 | 73 20 77 69 74 68 20 74 |e a clas|s with t|
|000002f0| 68 65 20 6e 61 6d 65 20 | 22 44 6f 69 6e 67 49 74 |he name |"DoingIt|
|00000300| 4d 79 57 61 79 22 2c 20 | 61 64 64 20 74 68 65 20 |MyWay", |add the |
|00000310| 6e 61 6d 65 0d 22 44 6f | 61 62 6c 65 22 20 74 6f |name."Do|able" to|
|00000320| 20 69 74 73 20 49 6e 74 | 65 72 66 61 63 65 73 20 | its Int|erfaces |
|00000330| 70 72 6f 70 65 72 74 69 | 65 73 2c 20 61 6e 64 20 |properti|es, and |
|00000340| 74 68 65 6e 20 69 6d 70 | 6c 65 6d 65 6e 74 20 74 |then imp|lement t|
|00000350| 68 65 0d 44 6f 49 74 20 | 66 75 6e 63 74 69 6f 6e |he.DoIt |function|
|00000360| 2c 20 6c 69 6b 65 20 74 | 68 69 73 3a 0d 0d 53 75 |, like t|his:..Su|
|00000370| 62 20 44 6f 49 74 28 29 | 0d 20 20 4d 73 67 42 6f |b DoIt()|. MsgBo|
|00000380| 78 20 22 54 68 61 74 27 | 73 20 6d 79 20 77 61 79 |x "That'|s my way|
|00000390| 2e 22 0d 45 6e 64 20 53 | 75 62 0d 0d 28 59 6f 75 |.".End S|ub..(You|
|000003a0| 20 63 61 6e 20 6e 6f 77 | 20 6f 66 20 63 6f 75 72 | can now| of cour|
|000003b0| 73 65 2c 20 63 72 65 61 | 74 65 20 6d 6f 72 65 20 |se, crea|te more |
|000003c0| 63 6c 61 73 73 65 73 20 | 6c 69 6b 65 20 74 68 69 |classes |like thi|
|000003d0| 73 2c 20 77 69 74 68 20 | 64 69 66 66 65 72 65 6e |s, with |differen|
|000003e0| 74 0d 69 6d 70 6c 65 6d | 65 6e 74 61 74 69 6f 6e |t.implem|entation|
|000003f0| 73 20 6f 66 20 22 44 6f | 49 74 22 29 0d 0d 4e 6f |s of "Do|It")..No|
|00000400| 77 2c 20 69 6d 61 67 69 | 6e 65 20 79 6f 75 20 68 |w, imagi|ne you h|
|00000410| 61 76 65 20 61 20 66 75 | 6e 63 74 69 6f 6e 20 73 |ave a fu|nction s|
|00000420| 6f 6d 65 77 68 65 72 65 | 20 74 68 61 74 20 79 6f |omewhere| that yo|
|00000430| 75 20 77 61 6e 74 20 74 | 6f 20 70 61 73 73 20 61 |u want t|o pass a|
|00000440| 0d 6d 65 74 68 6f 64 20 | 74 6f 20 65 78 65 63 75 |.method |to execu|
|00000450| 74 65 2e 20 54 68 61 74 | 20 77 6f 75 6c 64 20 74 |te. That| would t|
|00000460| 68 65 6e 20 6c 6f 6f 6b | 20 6c 69 6b 65 20 74 68 |hen look| like th|
|00000470| 69 73 3a 0d 0d 53 75 62 | 20 44 6f 54 68 69 73 20 |is:..Sub| DoThis |
|00000480| 28 70 65 72 66 6f 72 6d | 20 61 73 20 44 6f 61 62 |(perform| as Doab|
|00000490| 6c 65 29 0d 20 20 4d 73 | 67 42 6f 78 20 22 50 72 |le). Ms|gBox "Pr|
|000004a0| 65 73 73 20 4f 4b 20 74 | 6f 20 6c 65 74 20 6d 65 |ess OK t|o let me|
|000004b0| 20 70 65 72 66 6f 72 6d | 20 77 68 61 74 20 79 6f | perform| what yo|
|000004c0| 75 20 77 61 6e 74 20 6d | 65 20 74 6f 2e 2e 2e 22 |u want m|e to..."|
|000004d0| 0d 20 20 70 65 72 66 6f | 72 6d 28 29 0d 45 6e 64 |. perfo|rm().End|
|000004e0| 20 53 75 62 0d 0d 46 69 | 6e 61 6c 6c 79 2c 20 68 | Sub..Fi|nally, h|
|000004f0| 61 76 65 20 69 74 20 65 | 78 65 63 75 74 65 64 20 |ave it e|xecuted |
|00000500| 6c 69 6b 65 20 74 68 69 | 73 3a 0d 0d 20 20 44 69 |like thi|s:.. Di|
|00000510| 6d 20 6f 6e 65 57 61 79 | 54 6f 44 6f 49 74 20 61 |m oneWay|ToDoIt a|
|00000520| 73 20 44 6f 61 62 6c 65 | 0d 20 20 6f 6e 65 57 61 |s Doable|. oneWa|
|00000530| 79 54 6f 44 6f 49 74 20 | 3d 20 4e 65 77 20 44 6f |yToDoIt |= New Do|
|00000540| 69 6e 67 49 74 4d 79 57 | 61 79 28 29 0d 20 20 44 |ingItMyW|ay(). D|
|00000550| 6f 54 68 69 73 20 28 6f | 6e 65 57 61 79 54 6f 44 |oThis (o|neWayToD|
|00000560| 6f 49 74 29 0d 0d 49 74 | 20 6c 6f 6f 6b 73 20 61 |oIt)..It| looks a|
|00000570| 20 62 69 74 20 63 6f 6d | 62 65 72 73 6f 6d 65 2c | bit com|bersome,|
|00000580| 20 62 75 74 20 74 68 61 | 74 27 73 20 74 68 65 20 | but tha|t's the |
|00000590| 77 61 79 20 74 6f 20 64 | 6f 20 69 74 20 69 6e 20 |way to d|o it in |
|000005a0| 4f 4f 2d 6c 61 6e 67 75 | 61 67 65 73 0d 61 6e 64 |OO-langu|ages.and|
|000005b0| 20 74 68 69 73 20 69 73 | 20 61 20 63 6c 65 61 6e | this is| a clean|
|000005c0| 20 61 6e 64 20 6e 69 63 | 65 20 77 61 79 20 6f 6e | and nic|e way on|
|000005d0| 63 65 20 79 6f 75 20 67 | 65 74 20 75 73 65 64 20 |ce you g|et used |
|000005e0| 74 6f 20 69 74 2e 0d 41 | 64 64 69 6e 67 20 6f 74 |to it..A|dding ot|
|000005f0| 68 65 72 20 74 65 63 68 | 6e 69 71 75 65 73 2c 20 |her tech|niques, |
|00000600| 6c 69 6b 65 20 50 61 73 | 63 61 6c 2c 20 4d 6f 64 |like Pas|cal, Mod|
|00000610| 75 6c 61 2d 32 2c 20 43 | 20 6f 66 66 65 72 2c 20 |ula-2, C| offer, |
|00000620| 77 6f 75 6c 64 20 6e 6f | 74 0d 6c 6f 6f 6b 20 67 |would no|t.look g|
|00000630| 6f 6f 64 20 69 6e 20 74 | 68 69 73 20 4f 4f 20 65 |ood in t|his OO e|
|00000640| 6e 76 69 72 6f 6e 6d 65 | 6e 74 2e 0d 0d 54 68 6f |nvironme|nt...Tho|
|00000650| 6d 61 73 0d 00 00 00 16 | 00 01 00 00 00 00 00 0b |mas.....|........|
|00000660| 00 09 00 04 00 00 00 09 | 00 00 00 00 00 00 00 00 |........|........|
|00000670| 00 30 00 00 00 01 00 00 | 00 04 00 00 00 00 00 00 |.0......|........|
|00000680| 00 02 54 45 58 54 00 00 | 01 00 00 00 00 00 00 00 |..TEXT..|........|
|00000690| 00 00 73 74 79 6c 00 00 | 01 00 00 00 00 00 00 00 |..styl..|........|
|000006a0| 00 00 00 00 00 24 00 00 | 00 05 00 01 04 07 00 30 |.....$..|.......0|
|000006b0| 00 32 01 99 02 4d 00 03 | 00 00 00 00 01 70 8c 00 |.2...M..|.....p..|
|000006c0| 00 00 09 99 91 e0 00 00 | 00 00 00 00 01 00 00 00 |........|........|
|000006d0| 06 4a 00 00 05 4a 00 00 | 00 6e 09 75 f7 00 33 6a |.J...J..|.n.u..3j|
|000006e0| 00 00 00 1c 00 6e 00 03 | 54 45 58 54 00 00 00 22 |.....n..|TEXT..."|
|000006f0| 73 74 79 6c 00 00 00 2e | 64 72 61 67 00 00 00 3a |styl....|drag...:|
|00000700| 6b 77 73 74 00 00 00 46 | 01 00 ff ff 00 00 00 00 |kwst...F|........|
|00000710| 00 00 00 00 01 00 ff ff | 00 00 04 d4 00 00 00 00 |........|........|
|00000720| 00 80 ff ff 00 00 04 ee | 00 00 00 00 bf 4c ff ff |........|.....L..|
|00000730| 00 00 05 22 00 e2 67 58 | 00 00 00 00 00 00 00 00 |..."..gX|........|
|00000740| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000750| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000760| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
|00000770| 00 00 00 00 00 00 00 00 | 00 00 00 00 00 00 00 00 |........|........|
+--------+-------------------------+-------------------------+--------+--------+